Strings can be used to form matrices, in the same way that numeric
values can form a numeric matrix:
> StrMat = [ "A string", "Another String";
> "A third string", "The last string" ];
> StrMat
StrMat =
A string Another String
A third string The last string
> show(StrMat)
name: StrMat
class: string
type:
nr: 2
nc: 2
As shown here, the elements of a string matrix do not need to be the
same length. However scalar strings cannot be mixed with numeric
scalars in the same matrix — a list is the only variable capable of
making up a heterogeneous collection.